package com.espirit.finance.core;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.BatchSize;

import com.espirit.EntityMapping;
import com.espirit.eap.annotation.Dict;
import com.googlecode.cswish.model.Saas;

@Entity
@BatchSize(size=15)
public class AcctItemScope extends EntityMapping implements Serializable, Saas {
	private static final long serialVersionUID = 4843549395633817277L;

	public static final String STYLE = "acctitemscope_style";
	
	public static final Integer STYLE_PER_PRICE = 1;
	public static final Integer STYLE_AMOUNT = 2;
	public static final Integer STYLE_PROPERTY = 3;
	
	private BigDecimal from;
	private BigDecimal to;
	private BigDecimal price;
	private AcctItem parent;
	private Integer style;
	private AcctItemFactor acctItemFactor;
	private AcctItemRef acctItemRef;
	
	private Integer sid;
	public Integer getSid() {
		return sid;
	}

	public void setSid(Integer sid) {
		this.sid = sid;
	}
	
	@Column(name="fromQty")
	public BigDecimal getFrom() {
		return from;
	}
	public void setFrom(BigDecimal from) {
		this.from = from;
	}
	
	@Column(name="toQty")
	public BigDecimal getTo() {
		return to;
	}
	public void setTo(BigDecimal to) {
		this.to = to;
	}
	public BigDecimal getPrice() {
		return price;
	}
	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	public AcctItem getParent() {
		return parent;
	}

	public void setParent(AcctItem parent) {
		this.parent = parent;
	}

	@Dict(type=STYLE)
	public Integer getStyle() {
		return style;
	}

	public void setStyle(Integer style) {
		this.style = style;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	public AcctItemRef getAcctItemRef() {
		return acctItemRef;
	}

	public void setAcctItemRef(AcctItemRef acctItemRef) {
		this.acctItemRef = acctItemRef;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	public AcctItemFactor getAcctItemFactor() {
		return acctItemFactor;
	}

	public void setAcctItemFactor(AcctItemFactor acctItemFactor) {
		this.acctItemFactor = acctItemFactor;
	}
	
}
